﻿<?php
require_once(dirname(__FILE__)."/../../libs/login/login.php");
require_once(dirname(__FILE__)."/../../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/config_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$cf=new config();
//获得网站信息
$msg=$cf->getwebmsg();
//更新
if($mc->Ismp($_POST["msgbtn"])!=""){
	$webname=$mc->request("webname","");
	$logo=$mc->request("logo","");
	$banquan=$mc->request("banquan","");
	$keyword=$mc->request("keyword","");
	$miaoshu=$mc->request("miaoshu","");
	$beian=$mc->request("beian","");
	$tongji=$mc->request("tongji","");
	$kfqq=$mc->request("kfqq","");
	if($cf->updatemsg($webname,$logo,$banquan,$keyword,$miaoshu,$beian,$tongji,$kfqq)=='true'){
		$mc->msg("更新信息成功!","webmessage.php");
	}
}
$path="网站信息设置";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link rel="stylesheet" type="text/css" href="../../plug/swfupload/uploadify.css">
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<!--产品图片css!-->
<style>
.imgall{position: relative; width:100px; height:100px; float:left; margin-right:10px}

.imgall img{  }
.imgall span{ position:absolute; width:100px; height:32px;bottom:0px; display:none; }
.imgall:hover span{display:block;}
.imgall span input{float:right; cursor:pointer; background-image: url(../images/trash-alt-empty-32.png); width:32px; height:32px; border:0; }
</style>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/upload.js"></script>
<script type="text/javascript" src="../../plug/swfupload/jquery.min.js"></script>
<script type="text/javascript" src="../../plug/swfupload/jquery.uploadify-3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
        $('#file_upload').uploadify({
            'onSelect' :function(){shows3();},
			'onUploadSuccess' : function(file, data, response) {  
 		     // alert(data);
			  var board=document.getElementById("logo");
			  if(board.value!='')
			  {
			  	  $("#allpics").append("<div class='imgall'><img src='"+data+"' width='100' height='100' /><span><input type='button' title='删除'></span></div>");
				  board.value=board.value+','+data;
			  }else
			  {
			  	 $("#allpics").html("<div class='imgall'><img src='"+data+"' width='100' height='100' /><span><input type='button' title='删除'></span></div>");
			      board.value=data;
			  }
			  
			//成功后加载	删除修改图片代码		  
			$(".imgall input").each(function(i){
				$(this).click(function(){
					$(this).parent().parent().remove();
					var im="";
					$(".imgall").each(function(index){
						
						if(im==""){
							im=$(".imgall img:eq("+index+")").attr('src');
							}else{
							im+=","+$(".imgall img:eq("+index+")").attr('src');	
							}
					})
					  board.value=im;
					  if(im==""){
						 $("#allpics").html('<img src="../../plug/swfupload/moren.jpg" width="100px" height="100px" >');//如果为空，显示默认的图片
					   }
				})	
			})	  
		}, 	
			

		'onUploadStart' : function(file) {
		$("#file_upload").uploadify("settings","formData",{"pic1":$("#aaa").val()});
		},	
		
		'removeTimeout':'6',//进度条消失时间
		'method'   : 'post',
		'buttonImage':'',					
		'height': '30',
		'width': '75',
		'queueID' : 'some_file_queue',
		'displayData'    : 'percentage',
		'fileTypeExts'     : '*.jpg;*.jpeg;*.png;*.gif;*.bmp',
		'fileTypeDesc'    : '支持的格式(.JPG,.JPEG,.PNG,.GIF,.BMP)',//允许的格式
		'fileSizeLimit':'100024KB',//上传文件大小限制
		'queueSizeLimit':'10',//同时上传的文件最大数
		//'auto':false,//是否选取文件后自动上传
		'swf' : '../../plug/swfupload/uploadify.swf?ver='+ Math.random(),//是组件自带的flash，用于打开选取本地文件的按钮 
		'uploader' : '../../plug/swfupload/poster.php?type=3',
		'buttonText': '上传图片'	 
		// Your options here
     });		
});		
</script>
<script type="text/javascript"> 
// 增加输入框 
function AddRow()   
{  
  var i=3;      
  $("#photofile").append("<tr><td><input name='yq_name"+i+"' type='text' id='yq_name'  style='width:150px;' ></td><td><input name='yq_link"+i+"' type='text' id='youqing'  style='width:396px;' ></td></tr>");		
  i++;	
}

$(document).ready(function(){
	//输入框文字提示	
	$("input[class*=input_test]").each(function(){   
	   var oldVal=$(this).val(); 
	   $(this)   
	   .css({"color":"#adadad"})
	   .focus(function(){   
		if($(this).val()!=oldVal){$(this).css({"color":"#000"})}else{$(this).val("").css({"color":"#adadad"})}   
	   })   
	   .blur(function(){   
		if($(this).val()==""){$(this).val(oldVal).css({"color":"#adadad"})}   
	   }) 
	   .keydown(function(){$(this).css({"color":"#000"})})   
		 
	})
})
</script>
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="">

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td width="100%" height="24" class="top_head">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="1%" align="right"  height="45">&nbsp;</td>
                  <td width="99%" >
                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b></td>
                      <td width="45%" align="right">&nbsp;</td>
                    </tr>
                  </table>
                  </td>
                </tr>
              </table>
          </td>
        </tr>
 </table>
   
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">

  <tr>
    <td width="11%" height="40" align="right">网站名称：</td>
    <td height="40"><input name="webname" type="text" id="webname" value="<?php echo $msg["webname"]?>" ><Font>
   </Font></td>
    </tr>
      <tr>
    <td width="11%" height="40" align="right">关键字：</td>
    <td height="40"><input name="keyword" type="text" id="keyword" value="<?php echo $msg["keyword"]?>" ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="40" align="right" valign="middle">网站描述：</td>
    <td height="40" valign="middle"><textarea name="miaoshu" id="miaoshu" cols="30"  rows="2"><?php echo $msg["miaoshu"]?></textarea>
      <Font>
   </Font></td>
    </tr>
    <tr>
        <td width="11%" height="40" align="right">版权信息：</td>
        <td height="40"><input name="banquan" type="text" id="banquan" value="<?php echo $msg["banquan"]?>" ><Font>
       </Font>
       </td>
    </tr>
    <tr>
        <td width="11%" height="40" align="right">站长统计代码：</td>
        <td height="40"><input name="tongji" type="text" id="tongji" value="<?php echo $msg["tongji"]?>" ><Font>
       </Font>
       </td>
    </tr>
    <!-- <tr>
        <td width="11%" height="40" align="right">客服QQ：</td>
        <td height="40"><input name="kfqq" type="text" id="kfqq" value="<?php echo $msg["kfqq"]?>" ><Font>(多个用逗号隔开)
       </Font>
       </td>
    </tr>-->
  <!--  <tr>
        <td width="11%"  align="right" valign="top">友情链接：</td>
        <td>
        	<table id="photofile">
            	<tr >
                	<td> <input name="yq_name[]" type="text" id="yq_name" value="网站名字" class="input_test" style="width:150px"></td>
                    <td><input name="yq_link[]" type="text" id="yq_link" value="链接网址" class="input_test" style="width:396px;" ></td>
                </tr>
                <tr >
                	<td> <input name="yq_name[]" type="text" id="yq_name" value="网站名字" class="input_test" style="width:150px"></td>
                    <td><input name="yq_link[]" type="text" id="yq_link"  value="链接网址"  class="input_test" style="width:396px;" ></td>
                </tr>
            </table>
       
       </td>
    </tr>
    <tr>	
        <td  width="11%" height="20" >&nbsp;</td>
        <td height="20"><a class="buleLink" onClick="AddRow()">添加友情链接&gt;&gt;</a></td>
    </tr>-->
   <!--不需要网站logo，暂时隐藏 20131023-->
   <!-- <tr>
    <td width="11%" height="40" align="right">网站LOGO：</td>
    <td height="40"><input name="logo" type="text" id="logo" value="<?php echo $msg["logo"];?>"><div class="anniu"><input type="file" name="file_upload" id="file_upload" /></div><Font>
   </Font></td>
    </tr>
      <td height="40" align="right" valign="middle">图片预览：</td>
    <td height="40" valign="middle"><div id="allpics"><?php if($msg["logo"]==""){?><img src="../../plug/swfupload/moren.jpg" width='100px' height="100px" ><?php }else{?><img src="<?php echo $msg["logo"]?>" width='100px' height="100px" ><?php }?></div></td>
    </tr>-->
    
    <!--上传图片弹出对话框，显示上传的进度条!-->
  <!--  <div class="xz" id="Idiv3" style="display:none; z-index:100">
		<div class="xzleft"></div>
		<Div class="xzmid">
		  <h2>正在上传图片...</h2>
		  <p>最多上传1张图片，支持jpg,gif,png,jpeg格式</p>
		  <div id="some_file_queue"></div>
		  <Div class="anu"><input  type="button" onclick="$('#file_uploads3').uploadify('cancel','*');return closeDivs3()"  value="关闭" /></Div>
		</Div>
		<div class="xzright"></div>
	</div>	-->
  <tr>
    <td height="40" align="right" valign="middle">&nbsp;</td>
    <td height="40" valign="middle"><bdo>
      <input type="submit" name="msgbtn" value="提交">
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>

